主なコマンド
getblockchianinfo 実行例
$ bitcoin-cli getblockchaininfo
{
"chain": "regtest",
"blocks": 102,
"headers": 102,
"bestblockhash": "11202f9871c1c2f28445b721e4a4d2ee523cfd2be5a94b33626b3cf14094ce3b",
"difficulty": 4.656542373906925e-10,
"mediantime": 1550981230,
"verificationprogress": 1,
"initialblockdownload": false,
"chainwork": "00000000000000000000000000000000000000000000000000000000000000ce",
"size_on_disk": 32325,
"pruned": false,
"softforks": [
{
"id": "bip34",
"version": 2,
"reject": {
"status": false
}
},
{
"id": "bip66",
"version": 3,
"reject": {
"status": false
}
},
{
"id": "bip65",
"version": 4,
"reject": {
"status": false
}
}
],
"bip9_softforks": {
"csv": {
"status": "defined",
"startTime": 0,
"timeout": 9223372036854775807,
"since": 0
},
"segwit": {
"status": "active",
"startTime": -1,
"timeout": 9223372036854775807,
"since": 0
}
},
"warnings": ""
}
generate nblocks- regtestネットワーク限定コマンドで、
n 個のブロックを生成する
getwalletinfo実行例
$ bitcoin-cli getwalletinfo
{
"walletname": "",
"walletversion": 169900,
"balance": 99.99996260,
"unconfirmed_balance": 0.00000000,
"immature_balance": 5000.00003740,
"txcount": 103,
"keypoololdest": 1550981150,
"keypoolsize": 999,
"keypoolsize_hd_internal": 1000,
"paytxfee": 0.00000000,
"hdseedid": "389cb6e725210dce4b90ad6f075b637bbb4e15cb",
"hdmasterkeyid": "389cb6e725210dce4b90ad6f075b637bbb4e15cb",
"private_keys_enabled": true
}
getblock- ブロックハッシュを入力して、そのブロックを取得する
実行例
bc getblock 11202f9871c1c2f28445b721e4a4d2ee523cfd2be5a94b33626b3cf14094ce3b
{
"hash": "11202f9871c1c2f28445b721e4a4d2ee523cfd2be5a94b33626b3cf14094ce3b",
"confirmations": 1,
"strippedsize": 414,
"size": 450,
"weight": 1692,
"height": 102,
"version": 536870912,
"versionHex": "20000000",
"merkleroot": "b8fd170a5b6e2aac203fb824d6650a9cf832f0efc5c2dfa0a493256c08b360d7",
"tx": [
"de6288da90545a4f3263b3bccadae4a5841ff1171f05e7bc6f611ce48ee7d782",
"c2501059ceb99da51f93ce596f86dde2f22cd0700c2c4eb7f619d24f3c182fa9"
],
"time": 1550984102,
"mediantime": 1550981230,
"nonce": 5,
"bits": "207fffff",
"difficulty": 4.656542373906925e-10,
"chainwork": "00000000000000000000000000000000000000000000000000000000000000ce",
"nTx": 2,
"previousblockhash": "7887da582567755501bb2290f067a42808adbd0af87c5954b94b809c6a4a940c"
}
gettransaction- txidを入力して、transactionの中身を取得する
実行例
$ bc gettransaction de6288da90545a4f3263b3bccadae4a5841ff1171f05e7bc6f611ce48ee7d782
{
"amount": 0.00000000,
"confirmations": 1,
"generated": true,
"blockhash": "11202f9871c1c2f28445b721e4a4d2ee523cfd2be5a94b33626b3cf14094ce3b",
"blockindex": 0,
"blocktime": 1550984102,
"txid": "de6288da90545a4f3263b3bccadae4a5841ff1171f05e7bc6f611ce48ee7d782",
"walletconflicts": [
],
"time": 1550984102,
"timereceived": 1550984102,
"bip125-replaceable": "no",
"details": [
{
"address": "n4Me8VTaApZJMbeVuEM6PcsU67swc4RYu4",
"category": "immature",
"amount": 50.00003740,
"vout": 0
}
],
"hex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff0401660101ffffffff029c00062a0100000023210324a2b452db9ff1006b7aeca8264abf1ecf7a3140a7b75d42d762e2960fabc38bac0000000000000000266a24aa21a9ed7fbef1c44674c89beda7c65655b872f3998b686730d79d43b6a266647417aef40120000000000000000000000000000000000000000000000000000000000000000000000000"
}
全コマンド
== Blockchain ==
getbestblockhash
getblock "blockhash" ( verbosity )
getblockchaininfo
getblockcount
getblockhash height
getblockheader "hash" ( verbose )
getblockstats hash_or_height ( stats )
getchaintips
getchaintxstats ( nblocks blockhash )
getdifficulty
getmempoolancestors txid (verbose)
getmempooldescendants txid (verbose)
getmempoolentry txid
getmempoolinfo
getrawmempool ( verbose )
gettxout "txid" n ( include_mempool )
gettxoutproof ["txid",...] ( blockhash )
gettxoutsetinfo
preciousblock "blockhash"
pruneblockchain
savemempool
scantxoutset <action> ( <scanobjects> )
verifychain ( checklevel nblocks )
verifytxoutproof "proof"
== Control ==
getmemoryinfo ("mode")
help ( "command" )
logging ( <include> <exclude> )
stop
uptime
== Generating ==
generate nblocks ( maxtries )
generatetoaddress nblocks address (maxtries)
== Mining ==
getblocktemplate ( TemplateRequest )
getmininginfo
getnetworkhashps ( nblocks height )
prioritisetransaction <txid> <dummy value> <fee delta>
submitblock "hexdata" ( "dummy" )
== Network ==
addnode "node" "add|remove|onetry"
clearbanned
disconnectnode "[address]" [nodeid]
getaddednodeinfo ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban "subnet" "add|remove" (bantime) (absolute)
setnetworkactive true|false
== Rawtransactions ==
combinepsbt ["psbt",...]
combinerawtransaction ["hexstring",...]
converttopsbt "hexstring" ( permitsigdata iswitness )
createpsbt [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable )
createrawtransaction [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable )
decodepsbt "psbt"
decoderawtransaction "hexstring" ( iswitness )
decodescript "hexstring"
finalizepsbt "psbt" ( extract )
fundrawtransaction "hexstring" ( options iswitness )
getrawtransaction "txid" ( verbose "blockhash" )
sendrawtransaction "hexstring" ( allowhighfees )
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype )
testmempoolaccept ["rawtxs"] ( allowhighfees )
== Util ==
createmultisig nrequired ["key",...] ( "address_type" )
estimatesmartfee conf_target ("estimate_mode")
signmessagewithprivkey "privkey" "message"
validateaddress "address"
verifymessage "address" "signature" "message"
== Wallet ==
abandontransaction "txid"
abortrescan
addmultisigaddress nrequired ["key",...] ( "label" "address_type" )
backupwallet "destination"
bumpfee "txid" ( options )
createwallet "wallet_name" ( disable_private_keys )
dumpprivkey "address"
dumpwallet "filename"
encryptwallet "passphrase"
getaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
getaccountaddress (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
getaddressbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
getaddressesbylabel "label"
getaddressinfo "address"
getbalance ( "(dummy)" minconf include_watchonly )
getnewaddress ( "label" "address_type" )
getrawchangeaddress ( "address_type" )
getreceivedbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
getreceivedbyaddress "address" ( minconf )
gettransaction "txid" ( include_watchonly )
getunconfirmedbalance
getwalletinfo
importaddress "address" ( "label" rescan p2sh )
importmulti "requests" ( "options" )
importprivkey "privkey" ( "label" ) ( rescan )
importprunedfunds
importpubkey "pubkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaccounts (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
listaddressgroupings
listlabels ( "purpose" )
listlockunspent
listreceivedbyaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
listreceivedbyaddress ( minconf include_empty include_watchonly address_filter )
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
listtransactions (label count skip include_watchonly)
listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options])
listwallets
loadwallet "filename"
lockunspent unlock ([{"txid":"txid","vout":n},...])
move (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
removeprunedfunds "txid"
rescanblockchain ("start_height") ("stop_height")
sendfrom (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
sendmany "" {"address":amount,...} ( minconf "comment" ["address",...] replaceable conf_target "estimate_mode")
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode")
setaccount (Deprecated, will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts)
sethdseed ( "newkeypool" "seed" )
settxfee amount
signmessage "address" "message"
signrawtransactionwithwallet "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype )
unloadwallet ( "wallet_name" )
walletcreatefundedpsbt [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) ( replaceable ) ( options bip32derivs )
walletlock
walletpassphrase "passphrase" timeout
walletpassphrasechange "oldpassphrase" "newpassphrase"
walletprocesspsbt "psbt" ( sign "sighashtype" bip32derivs )